Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): implement FrameConn interface using quic-go #642

Merged
merged 20 commits into from
Nov 14, 2023

Conversation

woorui
Copy link
Collaborator

@woorui woorui commented Oct 10, 2023

Description

Implement new two frame-related interfaces below using quic-go.

// Listener accepts FrameConns.
type Listener interface {
	// Accept accepts FrameConns.
	Accept(context.Context) (FrameConn, error)
	// Close closes listener,
	// If listener be closed, all FrameConn accepted will be unavailable.
	Close() error
}

// FrameConn is a connection that transmits data in frame format.
type FrameConn interface {
	// Context returns FrameConn.Context.
	// The Context can be used to manage the lifecycle of connection and
	// retrieve error using `context.Cause(conn.Context())` after calling `CloseWithError()`.
	Context() context.Context
	// WriteFrame writes a frame to connection.
	WriteFrame(frame.Frame) error
	// ReadFrame returns a channel from which frames can be received.
	ReadFrame() (frame.Frame, error)
	// RemoteAddr returns the remote address of connection.
	RemoteAddr() net.Addr
	// LocalAddr returns the local address of connection.
	LocalAddr() net.Addr
	// CloseWithError closes the connection with an error message.
	// It will be unavailable if the connection is closed. the error message should be written to the conn.Context().
	CloseWithError(string) error
}

@vercel
Copy link

vercel bot commented Oct 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
yomo ⬜️ Ignored (Inspect) Visit Preview Nov 14, 2023 7:23am

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Attention: 88 lines in your changes are missing coverage. Please review.

Comparison is base (92788ae) 58.72% compared to head (a0541aa) 59.33%.
Report is 1 commits behind head on master.

Files Patch % Lines
pkg/listener/quic/quic.go 60.68% 35 Missing and 11 partials ⚠️
core/server.go 75.72% 18 Missing and 7 partials ⚠️
core/client.go 63.33% 9 Missing and 2 partials ⚠️
core/context.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #642      +/-   ##
==========================================
+ Coverage   58.72%   59.33%   +0.61%     
==========================================
  Files          36       36              
  Lines        2672     2715      +43     
==========================================
+ Hits         1569     1611      +42     
+ Misses       1008     1004       -4     
- Partials       95      100       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fanweixiao
Copy link
Member

🚀

@woorui woorui changed the title feat(core): frame quic connection refactor(core): implement FrameConn interface using quic-go Oct 29, 2023
@woorui woorui self-assigned this Oct 29, 2023
@woorui woorui marked this pull request as ready for review October 30, 2023 03:02
@woorui woorui requested review from venjiang, wujunzhuo and fanweixiao and removed request for venjiang and wujunzhuo October 30, 2023 03:02
@woorui woorui requested a review from venjiang November 14, 2023 07:26
@woorui woorui merged commit a628936 into master Nov 14, 2023
5 checks passed
@woorui woorui deleted the feat/frame-quic branch November 14, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants